﻿using System.Collections.Concurrent;

namespace Gentings.Storages
{
    /// <summary>
    /// 内容类型。
    /// </summary>
    public static class ContentTypes
    {
        private static readonly IDictionary<string, string> _contentTypes;

        static ContentTypes()
        {
            var contentTypes = new List<Tuple<string, string>>
            {
                new Tuple<string, string>(".epub", "application/epub+zip"),
                new Tuple<string, string>(".001", "application/x-001"),
                new Tuple<string, string>(".301", "application/x-301"),
                new Tuple<string, string>(".323", "text/h323"),
                new Tuple<string, string>(".906", "application/x-906"),
                new Tuple<string, string>(".907", "drawing/907"),
                new Tuple<string, string>(".a11", "application/x-a11"),
                new Tuple<string, string>(".acp", "audio/x-mei-aac"),
                new Tuple<string, string>(".ai", "application/postscript"),
                new Tuple<string, string>(".aif", "audio/aiff"),
                new Tuple<string, string>(".aifc", "audio/aiff"),
                new Tuple<string, string>(".aiff", "audio/aiff"),
                new Tuple<string, string>(".anv", "application/x-anv"),
                new Tuple<string, string>(".asa", "text/asa"),
                new Tuple<string, string>(".asf", "video/x-ms-asf"),
                new Tuple<string, string>(".asp", "text/asp"),
                new Tuple<string, string>(".asx", "video/x-ms-asf"),
                new Tuple<string, string>(".au", "audio/basic"),
                new Tuple<string, string>(".avi", "video/avi"),
                new Tuple<string, string>(".awf", "application/vnd.adobe.workflow"),
                new Tuple<string, string>(".biz", "text/xml"),
                new Tuple<string, string>(".bmp", "application/x-bmp"),
                new Tuple<string, string>(".bot", "application/x-bot"),
                new Tuple<string, string>(".c4t", "application/x-c4t"),
                new Tuple<string, string>(".c90", "application/x-c90"),
                new Tuple<string, string>(".cal", "application/x-cals"),
                new Tuple<string, string>(".cat", "application/vnd.ms-pki.seccat"),
                new Tuple<string, string>(".cdf", "application/x-netcdf"),
                new Tuple<string, string>(".cdr", "application/x-cdr"),
                new Tuple<string, string>(".cel", "application/x-cel"),
                new Tuple<string, string>(".cer", "application/x-x509-ca-cert"),
                new Tuple<string, string>(".cg4", "application/x-g4"),
                new Tuple<string, string>(".cgm", "application/x-cgm"),
                new Tuple<string, string>(".cit", "application/x-cit"),
                new Tuple<string, string>(".class", "java/*"),
                new Tuple<string, string>(".cml", "text/xml"),
                new Tuple<string, string>(".cmp", "application/x-cmp"),
                new Tuple<string, string>(".cmx", "application/x-cmx"),
                new Tuple<string, string>(".cot", "application/x-cot"),
                new Tuple<string, string>(".crl", "application/pkix-crl"),
                new Tuple<string, string>(".crt", "application/x-x509-ca-cert"),
                new Tuple<string, string>(".csi", "application/x-csi"),
                new Tuple<string, string>(".css", "text/css"),
                new Tuple<string, string>(".cut", "application/x-cut"),
                new Tuple<string, string>(".dbf", "application/x-dbf"),
                new Tuple<string, string>(".dbm", "application/x-dbm"),
                new Tuple<string, string>(".dbx", "application/x-dbx"),
                new Tuple<string, string>(".dcd", "text/xml"),
                new Tuple<string, string>(".dcx", "application/x-dcx"),
                new Tuple<string, string>(".der", "application/x-x509-ca-cert"),
                new Tuple<string, string>(".dgn", "application/x-dgn"),
                new Tuple<string, string>(".dib", "application/x-dib"),
                new Tuple<string, string>(".dll", "application/x-msdownload"),
                new Tuple<string, string>(".doc", "application/msword"),
                new Tuple<string, string>(".dot", "application/msword"),
                new Tuple<string, string>(".drw", "application/x-drw"),
                new Tuple<string, string>(".dtd", "text/xml"),
                new Tuple<string, string>(".dwf", "Model/vnd.dwf"),
                new Tuple<string, string>(".dwg", "application/x-dwg"),
                new Tuple<string, string>(".dxb", "application/x-dxb"),
                new Tuple<string, string>(".dxf", "application/x-dxf"),
                new Tuple<string, string>(".edn", "application/vnd.adobe.edn"),
                new Tuple<string, string>(".emf", "application/x-emf"),
                new Tuple<string, string>(".eml", "message/rfc822"),
                new Tuple<string, string>(".ent", "text/xml"),
                new Tuple<string, string>(".epi", "application/x-epi"),
                new Tuple<string, string>(".eps", "application/postscript"),
                new Tuple<string, string>(".etd", "application/x-ebx"),
                new Tuple<string, string>(".exe", "application/x-msdownload"),
                new Tuple<string, string>(".fax", "image/fax"),
                new Tuple<string, string>(".fdf", "application/vnd.fdf"),
                new Tuple<string, string>(".fif", "application/fractals"),
                new Tuple<string, string>(".fo", "text/xml"),
                new Tuple<string, string>(".frm", "application/x-frm"),
                new Tuple<string, string>(".g4", "application/x-g4"),
                new Tuple<string, string>(".gbr", "application/x-gbr"),
                new Tuple<string, string>(".gif", "image/gif"),
                new Tuple<string, string>(".gl2", "application/x-gl2"),
                new Tuple<string, string>(".gp4", "application/x-gp4"),
                new Tuple<string, string>(".hgl", "application/x-hgl"),
                new Tuple<string, string>(".hmr", "application/x-hmr"),
                new Tuple<string, string>(".hpg", "application/x-hpgl"),
                new Tuple<string, string>(".hpl", "application/x-hpl"),
                new Tuple<string, string>(".hqx", "application/mac-binhex40"),
                new Tuple<string, string>(".hrf", "application/x-hrf"),
                new Tuple<string, string>(".hta", "application/hta"),
                new Tuple<string, string>(".htc", "text/x-component"),
                new Tuple<string, string>(".htm", "text/html"),
                new Tuple<string, string>(".html", "text/html"),
                new Tuple<string, string>(".htt", "text/webviewhtml"),
                new Tuple<string, string>(".htx", "text/html"),
                new Tuple<string, string>(".icb", "application/x-icb"),
                new Tuple<string, string>(".ico", "image/x-icon"),
                new Tuple<string, string>(".iff", "application/x-iff"),
                new Tuple<string, string>(".ig4", "application/x-g4"),
                new Tuple<string, string>(".igs", "application/x-igs"),
                new Tuple<string, string>(".iii", "application/x-iphone"),
                new Tuple<string, string>(".img", "application/x-img"),
                new Tuple<string, string>(".ins", "application/x-internet-signup"),
                new Tuple<string, string>(".isp", "application/x-internet-signup"),
                new Tuple<string, string>(".IVF", "video/x-ivf"),
                new Tuple<string, string>(".java", "java/*"),
                new Tuple<string, string>(".jfif", "image/jpeg"),
                new Tuple<string, string>(".jpe", "image/jpeg"),
                new Tuple<string, string>(".jpeg", "image/jpeg"),
                new Tuple<string, string>(".jpg", "image/jpeg"),
                new Tuple<string, string>(".js", "application/x-javascript"),
                new Tuple<string, string>(".jsp", "text/html"),
                new Tuple<string, string>(".la1", "audio/x-liquid-file"),
                new Tuple<string, string>(".lar", "application/x-laplayer-reg"),
                new Tuple<string, string>(".latex", "application/x-latex"),
                new Tuple<string, string>(".lavs", "audio/x-liquid-secure"),
                new Tuple<string, string>(".lbm", "application/x-lbm"),
                new Tuple<string, string>(".lmsff", "audio/x-la-lms"),
                new Tuple<string, string>(".ls", "application/x-javascript"),
                new Tuple<string, string>(".ltr", "application/x-ltr"),
                new Tuple<string, string>(".m1v", "video/x-mpeg"),
                new Tuple<string, string>(".m2v", "video/x-mpeg"),
                new Tuple<string, string>(".m3u", "audio/mpegurl"),
                new Tuple<string, string>(".m4e", "video/mpeg4"),
                new Tuple<string, string>(".mac", "application/x-mac"),
                new Tuple<string, string>(".man", "application/x-troff-man"),
                new Tuple<string, string>(".math", "text/xml"),
                new Tuple<string, string>(".mdb", "application/msaccess"),
                new Tuple<string, string>(".mfp", "application/x-shockwave-flash"),
                new Tuple<string, string>(".mht", "message/rfc822"),
                new Tuple<string, string>(".mhtml", "message/rfc822"),
                new Tuple<string, string>(".mi", "application/x-mi"),
                new Tuple<string, string>(".mid", "audio/mid"),
                new Tuple<string, string>(".midi", "audio/mid"),
                new Tuple<string, string>(".mil", "application/x-mil"),
                new Tuple<string, string>(".mml", "text/xml"),
                new Tuple<string, string>(".mnd", "audio/x-musicnet-download"),
                new Tuple<string, string>(".mns", "audio/x-musicnet-stream"),
                new Tuple<string, string>(".mocha", "application/x-javascript"),
                new Tuple<string, string>(".movie", "video/x-sgi-movie"),
                new Tuple<string, string>(".mp1", "audio/mp1"),
                new Tuple<string, string>(".mp2", "audio/mp2"),
                new Tuple<string, string>(".mp2v", "video/mpeg"),
                new Tuple<string, string>(".mp3", "audio/mp3"),
                new Tuple<string, string>(".mp4", "video/mpeg4"),
                new Tuple<string, string>(".mpa", "video/x-mpg"),
                new Tuple<string, string>(".mpd", "application/vnd.ms-project"),
                new Tuple<string, string>(".mpe", "video/x-mpeg"),
                new Tuple<string, string>(".mpeg", "video/mpg"),
                new Tuple<string, string>(".mpg", "video/mpg"),
                new Tuple<string, string>(".mpga", "audio/rn-mpeg"),
                new Tuple<string, string>(".mpp", "application/vnd.ms-project"),
                new Tuple<string, string>(".mps", "video/x-mpeg"),
                new Tuple<string, string>(".mpt", "application/vnd.ms-project"),
                new Tuple<string, string>(".mpv", "video/mpg"),
                new Tuple<string, string>(".mpv2", "video/mpeg"),
                new Tuple<string, string>(".mpw", "application/vnd.ms-project"),
                new Tuple<string, string>(".mpx", "application/vnd.ms-project"),
                new Tuple<string, string>(".mtx", "text/xml"),
                new Tuple<string, string>(".mxp", "application/x-mmxp"),
                new Tuple<string, string>(".net", "image/pnetvue"),
                new Tuple<string, string>(".nrf", "application/x-nrf"),
                new Tuple<string, string>(".nws", "message/rfc822"),
                new Tuple<string, string>(".odc", "text/x-ms-odc"),
                new Tuple<string, string>(".out", "application/x-out"),
                new Tuple<string, string>(".p10", "application/pkcs10"),
                new Tuple<string, string>(".p12", "application/x-pkcs12"),
                new Tuple<string, string>(".p7b", "application/x-pkcs7-certificates"),
                new Tuple<string, string>(".p7c", "application/pkcs7-mime"),
                new Tuple<string, string>(".p7m", "application/pkcs7-mime"),
                new Tuple<string, string>(".p7r", "application/x-pkcs7-certreqresp"),
                new Tuple<string, string>(".p7s", "application/pkcs7-signature"),
                new Tuple<string, string>(".pc5", "application/x-pc5"),
                new Tuple<string, string>(".pci", "application/x-pci"),
                new Tuple<string, string>(".pcl", "application/x-pcl"),
                new Tuple<string, string>(".pcx", "application/x-pcx"),
                new Tuple<string, string>(".pdf", "application/pdf"),
                new Tuple<string, string>(".pdx", "application/vnd.adobe.pdx"),
                new Tuple<string, string>(".pfx", "application/x-pkcs12"),
                new Tuple<string, string>(".pgl", "application/x-pgl"),
                new Tuple<string, string>(".pic", "application/x-pic"),
                new Tuple<string, string>(".pko", "application/vnd.ms-pki.pko"),
                new Tuple<string, string>(".pl", "application/x-perl"),
                new Tuple<string, string>(".plg", "text/html"),
                new Tuple<string, string>(".pls", "audio/scpls"),
                new Tuple<string, string>(".plt", "application/x-plt"),
                new Tuple<string, string>(".png", "image/png"),
                new Tuple<string, string>(".pot", "application/vnd.ms-powerpoint"),
                new Tuple<string, string>(".ppa", "application/vnd.ms-powerpoint"),
                new Tuple<string, string>(".ppm", "application/x-ppm"),
                new Tuple<string, string>(".pps", "application/vnd.ms-powerpoint"),
                new Tuple<string, string>(".ppt", "application/vnd.ms-powerpoint"),
                new Tuple<string, string>(".pr", "application/x-pr"),
                new Tuple<string, string>(".prf", "application/pics-rules"),
                new Tuple<string, string>(".prn", "application/x-prn"),
                new Tuple<string, string>(".prt", "application/x-prt"),
                new Tuple<string, string>(".ps", "application/postscript"),
                new Tuple<string, string>(".ptn", "application/x-ptn"),
                new Tuple<string, string>(".pwz", "application/vnd.ms-powerpoint"),
                new Tuple<string, string>(".r3t", "text/vnd.rn-realtext3d"),
                new Tuple<string, string>(".ra", "audio/vnd.rn-realaudio"),
                new Tuple<string, string>(".ram", "audio/x-pn-realaudio"),
                new Tuple<string, string>(".ras", "application/x-ras"),
                new Tuple<string, string>(".rat", "application/rat-file"),
                new Tuple<string, string>(".rdf", "text/xml"),
                new Tuple<string, string>(".rec", "application/vnd.rn-recording"),
                new Tuple<string, string>(".red", "application/x-red"),
                new Tuple<string, string>(".rgb", "application/x-rgb"),
                new Tuple<string, string>(".rjs", "application/vnd.rn-realsystem-rjs"),
                new Tuple<string, string>(".rjt", "application/vnd.rn-realsystem-rjt"),
                new Tuple<string, string>(".rlc", "application/x-rlc"),
                new Tuple<string, string>(".rle", "application/x-rle"),
                new Tuple<string, string>(".rm", "application/vnd.rn-realmedia"),
                new Tuple<string, string>(".rmf", "application/vnd.adobe.rmf"),
                new Tuple<string, string>(".rmi", "audio/mid"),
                new Tuple<string, string>(".rmj", "application/vnd.rn-realsystem-rmj"),
                new Tuple<string, string>(".rmm", "audio/x-pn-realaudio"),
                new Tuple<string, string>(".rmp", "application/vnd.rn-rn_music_package"),
                new Tuple<string, string>(".rms", "application/vnd.rn-realmedia-secure"),
                new Tuple<string, string>(".rmvb", "application/vnd.rn-realmedia-vbr"),
                new Tuple<string, string>(".rmx", "application/vnd.rn-realsystem-rmx"),
                new Tuple<string, string>(".rnx", "application/vnd.rn-realplayer"),
                new Tuple<string, string>(".rp", "image/vnd.rn-realpix"),
                new Tuple<string, string>(".rpm", "audio/x-pn-realaudio-plugin"),
                new Tuple<string, string>(".rsml", "application/vnd.rn-rsml"),
                new Tuple<string, string>(".rt", "text/vnd.rn-realtext"),
                new Tuple<string, string>(".rtf", "application/msword"),
                new Tuple<string, string>(".rv", "video/vnd.rn-realvideo"),
                new Tuple<string, string>(".sam", "application/x-sam"),
                new Tuple<string, string>(".sat", "application/x-sat"),
                new Tuple<string, string>(".sdp", "application/sdp"),
                new Tuple<string, string>(".sdw", "application/x-sdw"),
                new Tuple<string, string>(".sit", "application/x-stuffit"),
                new Tuple<string, string>(".slb", "application/x-slb"),
                new Tuple<string, string>(".sld", "application/x-sld"),
                new Tuple<string, string>(".slk", "drawing/x-slk"),
                new Tuple<string, string>(".smi", "application/smil"),
                new Tuple<string, string>(".smil", "application/smil"),
                new Tuple<string, string>(".smk", "application/x-smk"),
                new Tuple<string, string>(".snd", "audio/basic"),
                new Tuple<string, string>(".sol", "text/plain"),
                new Tuple<string, string>(".sor", "text/plain"),
                new Tuple<string, string>(".spc", "application/x-pkcs7-certificates"),
                new Tuple<string, string>(".spl", "application/futuresplash"),
                new Tuple<string, string>(".spp", "text/xml"),
                new Tuple<string, string>(".ssm", "application/streamingmedia"),
                new Tuple<string, string>(".sst", "application/vnd.ms-pki.certstore"),
                new Tuple<string, string>(".stl", "application/vnd.ms-pki.stl"),
                new Tuple<string, string>(".stm", "text/html"),
                new Tuple<string, string>(".sty", "application/x-sty"),
                new Tuple<string, string>(".svg", "text/xml"),
                new Tuple<string, string>(".swf", "application/x-shockwave-flash"),
                new Tuple<string, string>(".tdf", "application/x-tdf"),
                new Tuple<string, string>(".tg4", "application/x-tg4"),
                new Tuple<string, string>(".tga", "application/x-tga"),
                new Tuple<string, string>(".tif", "image/tiff"),
                new Tuple<string, string>(".tiff", "image/tiff"),
                new Tuple<string, string>(".tld", "text/xml"),
                new Tuple<string, string>(".top", "drawing/x-top"),
                new Tuple<string, string>(".torrent", "application/x-bittorrent"),
                new Tuple<string, string>(".tsd", "text/xml"),
                new Tuple<string, string>(".txt", "text/plain"),
                new Tuple<string, string>(".uin", "application/x-icq"),
                new Tuple<string, string>(".uls", "text/iuls"),
                new Tuple<string, string>(".vcf", "text/x-vcard"),
                new Tuple<string, string>(".vda", "application/x-vda"),
                new Tuple<string, string>(".vdx", "application/vnd.visio"),
                new Tuple<string, string>(".vml", "text/xml"),
                new Tuple<string, string>(".vpg", "application/x-vpeg005"),
                new Tuple<string, string>(".vsd", "application/vnd.visio"),
                new Tuple<string, string>(".vss", "application/vnd.visio"),
                new Tuple<string, string>(".vst", "application/vnd.visio"),
                new Tuple<string, string>(".vsw", "application/vnd.visio"),
                new Tuple<string, string>(".vsx", "application/vnd.visio"),
                new Tuple<string, string>(".vtx", "application/vnd.visio"),
                new Tuple<string, string>(".vxml", "text/xml"),
                new Tuple<string, string>(".wav", "audio/wav"),
                new Tuple<string, string>(".wax", "audio/x-ms-wax"),
                new Tuple<string, string>(".wb1", "application/x-wb1"),
                new Tuple<string, string>(".wb2", "application/x-wb2"),
                new Tuple<string, string>(".wb3", "application/x-wb3"),
                new Tuple<string, string>(".wbmp", "image/vnd.wap.wbmp"),
                new Tuple<string, string>(".wiz", "application/msword"),
                new Tuple<string, string>(".wk3", "application/x-wk3"),
                new Tuple<string, string>(".wk4", "application/x-wk4"),
                new Tuple<string, string>(".wkq", "application/x-wkq"),
                new Tuple<string, string>(".wks", "application/x-wks"),
                new Tuple<string, string>(".wm", "video/x-ms-wm"),
                new Tuple<string, string>(".wma", "audio/x-ms-wma"),
                new Tuple<string, string>(".wmd", "application/x-ms-wmd"),
                new Tuple<string, string>(".wmf", "application/x-wmf"),
                new Tuple<string, string>(".wml", "text/vnd.wap.wml"),
                new Tuple<string, string>(".wmv", "video/x-ms-wmv"),
                new Tuple<string, string>(".wmx", "video/x-ms-wmx"),
                new Tuple<string, string>(".wmz", "application/x-ms-wmz"),
                new Tuple<string, string>(".wp6", "application/x-wp6"),
                new Tuple<string, string>(".wpd", "application/x-wpd"),
                new Tuple<string, string>(".wpg", "application/x-wpg"),
                new Tuple<string, string>(".wpl", "application/vnd.ms-wpl"),
                new Tuple<string, string>(".wq1", "application/x-wq1"),
                new Tuple<string, string>(".wr1", "application/x-wr1"),
                new Tuple<string, string>(".wri", "application/x-wri"),
                new Tuple<string, string>(".wrk", "application/x-wrk"),
                new Tuple<string, string>(".ws", "application/x-ws"),
                new Tuple<string, string>(".ws2", "application/x-ws"),
                new Tuple<string, string>(".wsc", "text/scriptlet"),
                new Tuple<string, string>(".wsdl", "text/xml"),
                new Tuple<string, string>(".wvx", "video/x-ms-wvx"),
                new Tuple<string, string>(".xdp", "application/vnd.adobe.xdp"),
                new Tuple<string, string>(".xdr", "text/xml"),
                new Tuple<string, string>(".xfd", "application/vnd.adobe.xfd"),
                new Tuple<string, string>(".xfdf", "application/vnd.adobe.xfdf"),
                new Tuple<string, string>(".xhtml", "text/html"),
                new Tuple<string, string>(".xls", "application/vnd.ms-excel"),
                new Tuple<string, string>(".xlw", "application/x-xlw"),
                new Tuple<string, string>(".xml", "text/xml"),
                new Tuple<string, string>(".xpl", "audio/scpls"),
                new Tuple<string, string>(".xq", "text/xml"),
                new Tuple<string, string>(".xql", "text/xml"),
                new Tuple<string, string>(".xquery", "text/xml"),
                new Tuple<string, string>(".xsd", "text/xml"),
                new Tuple<string, string>(".xsl", "text/xml"),
                new Tuple<string, string>(".xslt", "text/xml"),
                new Tuple<string, string>(".xwd", "application/x-xwd"),
                new Tuple<string, string>(".x_b", "application/x-x_b"),
                new Tuple<string, string>(".sis", "application/vnd.symbian.install"),
                new Tuple<string, string>(".sisx", "application/vnd.symbian.install"),
                new Tuple<string, string>(".x_t", "application/x-x_t"),
                new Tuple<string, string>(".ipa", "application/vnd.iphone"),
                new Tuple<string, string>(".apk", "application/vnd.android.package-archive"),
                new Tuple<string, string>(".xap", "application/x-silverlight-app"),new Tuple<string, string>(".doc","application/msword"),
                new Tuple<string, string>(".dot","application/msword"),
                new Tuple<string, string>(".docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),
                new Tuple<string, string>(".dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),
                new Tuple<string, string>(".docm","application/vnd.ms-word.document.macroEnabled.12"),
                new Tuple<string, string>(".dotm","application/vnd.ms-word.template.macroEnabled.12"),
                new Tuple<string, string>(".xls","application/vnd.ms-excel"),
                new Tuple<string, string>(".xlt","application/vnd.ms-excel"),
                new Tuple<string, string>(".xla","application/vnd.ms-excel"),
                new Tuple<string, string>(".xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),
                new Tuple<string, string>(".xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),
                new Tuple<string, string>(".xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),
                new Tuple<string, string>(".xltm","application/vnd.ms-excel.template.macroEnabled.12"),
                new Tuple<string, string>(".xlam","application/vnd.ms-excel.addin.macroEnabled.12"),
                new Tuple<string, string>(".xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),
                new Tuple<string, string>(".ppt","application/vnd.ms-powerpoint"),
                new Tuple<string, string>(".pot","application/vnd.ms-powerpoint"),
                new Tuple<string, string>(".pps","application/vnd.ms-powerpoint"),
                new Tuple<string, string>(".ppa","application/vnd.ms-powerpoint"),
                new Tuple<string, string>(".pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),
                new Tuple<string, string>(".potx","application/vnd.openxmlformats-officedocument.presentationml.template"),
                new Tuple<string, string>(".ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),
                new Tuple<string, string>(".ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),
                new Tuple<string, string>(".pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),
                new Tuple<string, string>(".potm","application/vnd.ms-powerpoint.template.macroEnabled.12"),
                new Tuple<string, string>(".ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),
            };
            _contentTypes = new ConcurrentDictionary<string, string>(StringComparer.OrdinalIgnoreCase);
            foreach (var contentType in contentTypes)
            {
                _contentTypes[contentType.Item1] = contentType.Item2;
            }
        }

        /// <summary>
        /// 获取内容类型。
        /// </summary>
        /// <param name="extension">扩展名称。</param>
        /// <returns>返回内容类型。</returns>
        public static string GetContentType(this string extension)
        {
            if (_contentTypes.TryGetValue(extension, out var contentType))
            {
                return contentType;
            }

            return "application/octet-stream";
        }

        /// <summary>
        /// 获取内容类型。
        /// </summary>
        /// <param name="fileName">文件名称。</param>
        /// <returns>返回内容类型。</returns>
        public static string GetFileContentType(this string fileName)
        {
            return Path.GetFileNameWithoutExtension(fileName).GetContentType();
        }
    }
}